]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Remove do-not-disturb switch
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 10 Apr 2025 18:22:22 +0000 (20:22 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 27 Jun 2025 11:36:17 +0000 (11:36 +0000)
While clearly related to notifications, having it in the already quite
crowded date/notification popover is quite awkward.

Also the canonical place for quickly accessing commonly used settings
is the quick settings menu nowadays.

So remove the existing control from the calendar menu before re-adding
the feature as quick toggle.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3691>

data/theme/gnome-shell-sass/widgets/_message-list.scss
js/ui/calendar.js

index 2b289b47f10262043e98039d525c963b6d06b1f8..65e328fbb3600c4702f1346812a86db36f9a447c 100644 (file)
   padding-bottom: $base_padding;
   spacing: $base_padding;
   @extend %heading;
-
-  .dnd-button {
-    // We need this because the focus outline isn't inset like for the buttons
-    // so the dnd button would grow when it gets focus if we didn't change only
-    // its color when focusing.
-    border-width: 2px;
-    border-color: transparent;
-    border-radius: 32px;
-    border-style: solid;
-
-    &:focus {
-      border-color: st-transparentize(-st-accent-color, 0.4);
-    }
-  }
 }
 
 // message notification group
index c0610ba6f794ae4874aa1a17cb6bf1f8d9c361a1..936854c5acae5272da8c6a0309291517d3f23934 100644 (file)
@@ -6,7 +6,6 @@ import Shell from 'gi://Shell';
 import St from 'gi://St';
 
 import * as MessageList from './messageList.js';
-import * as PopupMenu from './popupMenu.js';
 import {ensureActorVisibleInScrollView} from '../misc/animationUtils.js';
 
 import {formatDateWithCFormatString} from '../misc/dateUtils.js';
@@ -776,26 +775,6 @@ class Placeholder extends St.BoxLayout {
     }
 });
 
-const DoNotDisturbSwitch = GObject.registerClass(
-class DoNotDisturbSwitch extends PopupMenu.Switch {
-    _init() {
-        this._settings = new Gio.Settings({
-            schema_id: 'org.gnome.desktop.notifications',
-        });
-
-        super._init(this._settings.get_boolean('show-banners'));
-
-        this._settings.bind('show-banners',
-            this, 'state',
-            Gio.SettingsBindFlags.INVERT_BOOLEAN);
-
-        this.connect('destroy', () => {
-            Gio.Settings.unbind(this, 'state');
-            this._settings = null;
-        });
-    }
-});
-
 export const CalendarMessageList = GObject.registerClass(
 class CalendarMessageList extends St.Widget {
     constructor() {
@@ -828,26 +807,6 @@ class CalendarMessageList extends St.Widget {
         let hbox = new St.BoxLayout({style_class: 'message-list-controls'});
         box.add_child(hbox);
 
-        const dndLabel = new St.Label({
-            text: _('Do Not Disturb'),
-            y_align: Clutter.ActorAlign.CENTER,
-        });
-        hbox.add_child(dndLabel);
-
-        this._dndSwitch = new DoNotDisturbSwitch();
-        this._dndButton = new St.Button({
-            style_class: 'dnd-button',
-            can_focus: true,
-            toggle_mode: true,
-            child: this._dndSwitch,
-            label_actor: dndLabel,
-            y_align: Clutter.ActorAlign.CENTER,
-        });
-        this._dndSwitch.bind_property('state',
-            this._dndButton, 'checked',
-            GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE);
-        hbox.add_child(this._dndButton);
-
         this._clearButton = new St.Button({
             style_class: 'message-list-clear-button button',
             label: _('Clear'),